From e76525a403adf42518bb3db3ec2b595181d97480 Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 21 Feb 2007 16:39:54 +0000 Subject: [PATCH] Enhance smartname code to special case 7 digit geocache names in 6 digit receivers. --- mkshort.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mkshort.c b/mkshort.c index d2b928fc4..28a01631e 100644 --- a/mkshort.c +++ b/mkshort.c @@ -382,6 +382,19 @@ mkshort(short_handle h, const char *istring) int i, l, nlen, replaced; mkshort_handle *hdl = (mkshort_handle *) h; + + /* + * A rather horrible special case hack. + * If the target length is "6" and the source length is "7" and + * the first two characters are "GC", we'll assume it's one of the + * the new seven digit geocache numbers and special case whacking + * the 'G' off the front. + */ + if ((hdl->target_len == 6) && (strlen(ostring) == 7) && + (ostring[0] == 'G') && (ostring[1] == 'C')) { + memmove(&ostring[0], &ostring[1], strlen(ostring)); + } + /* * Whack leading "[Tt]he", */ -- 2.30.2